//
//  YGUility.h
//  YangGe
//
//  Created by EDZ on 2018/12/7.
//  Copyright © 2018 YG. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "NSDate+SSToolkitAdditions.h"
#import "NSString+dateFormatter.h"


NS_ASSUME_NONNULL_BEGIN

@interface YGUility : NSObject
+ (NSString *)timeWithTimeIntervalString:(NSString *)timeString andIsState:(NSInteger)state;
+ (NSString *)timeWithTimeIntervalStringNew:(NSString *)timeString;
+(UIImage*)imageWithImage:(UIImage*)image scaledToSize:(CGSize)newSize;

+(CGFloat)heighForCell: (NSString *)content andSize:(CGSize )size andFont:(CGFloat)fontHeight;

+ (NSDate *)getDatetampFromTime:(NSString *)dateStr;

/**
 过去时间转化
 
 @param timeString 时间戳
 @return 返回时间
 */
+ (NSString *)timeIntervalDescriptionString:(NSString *)timeString;

+ (NSString *)gjString:(NSString *)str;

+ (UIImage *)imageWithColor:(UIColor *)color;

+ (NSString*)weekdayStringFromDate:(NSString*)featureDate;

+ (NSString *)checkTheDate:(NSString *)string;

/**
 退出登录清空数据
 */
+ (void)outLogin;

/**
 金额转换
 
 @param string 金额字符串
 @return 处理后的字符串
 */
+ (NSString *)gjFloatString:(NSString *)string;

/**
 金额转换
 
 @param string 金额字符串
 @return 处理后的字符串 1k 1w 10w+
 */
+ (NSString *)gjPriceString:(NSString *)string;

/**
 金额转换
 
 @param number 点赞数
 @return 处理后的字符串 1k 1w 10w+
 */
+ (NSString *)gjFollowString:(NSInteger )number;

//根据宽度计算高度
+ (CGFloat)getLabelHeightWithText:(NSString *)text width:(CGFloat)width font: (CGFloat)font;
//根据高度度求宽度  text 计算的内容  Height 计算的高度 font字体大小
+ (CGFloat)getWidthWithText:(NSString *)text height:(CGFloat)height font:(CGFloat)font;



/**
 view 传入要变圆角的视图
 size自己根据需要设置角度大小
 后面的4个角 BOOL 1 是设置该角为圆角 0 不改变
 */
+ (void)renYiYuanJiao:(UIView *)view size:(CGSize)size left:(BOOL)left right:(BOOL)right bottomLeft:(BOOL)bottomLeft bottomRight:(BOOL)bottomRight;


/**
 将UTC日期字符串转为本地时间字符串
 eg: 2017-10-25 02:07:39  -> 2017-10-25 10:07:39
 */
+ (NSString *)getLocalDateFormateUTCDate:(NSString *)utcStr;

//去除空格和换行
+ (NSString *)removeSpaceAndNewline:(NSString *)str;
/**
是否含有Emoji表情
 */
+ (BOOL)stringContainsEmoji:(NSString *)string;

+(BOOL)judgePassWordLegal:(NSString *)pass;

+ (void)tel;
+ (void)tel:(NSString *)phone;


/*
 //金额转换成大写
 */
+ (NSString *)getAmountInWords:(NSString *)money;

/*
 时间转化成时间戳
 */
+(NSInteger)timeSwitchTimestamp:(NSString *)formatTime andFormatter:(NSString *)format;
/*
 时间格式转化
 */
+ (NSString *)dataZhuanHuan:(NSString *)timeString;

//获取当前时间
+ (NSString *)getCurrentTime:(NSInteger)type;
//传入今天的时间，返回明天的时间
+ (NSString *)GetTomorrowDay:(NSDate *)aDate;

/**
 字典转json字符串方法
 */
+(NSString *)convertToJsonData:(NSDictionary *)dict;

+ (CGFloat)hideLabelLayoutHeight:(NSMutableAttributedString *)content withTextFontSize:(CGFloat)mFontSize andWidth:(CGFloat)width;

+ (CGFloat)hideLabelLayoutWidth:(NSMutableAttributedString *)content withTextFontSize:(CGFloat)mFontSize andWidth:(CGFloat)height;


+ (NSString *)jsonStringWithDict:(id )dict;
/*
 旋转照片到正确方向
 */
+ (UIImage *)fixOrientation:(UIImage *)aImage;

//获取当前的时间
+(NSString*)getCurrentTimes;

+ (void)checkVideoAuthorization;
//去个人主页
+ (void)homePageTap:(NSString *)userNo;
//重新登陆
+ (void)toLogin;


@end

NS_ASSUME_NONNULL_END
